#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;
const int N = 1e5 + 10;

LL n, t;
LL presum[N];

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n >> t;
    for(int i = 1; i <= n; i ++){
        LL x;
        cin >> x;

        presum[i] = presum[i - 1] + x;
    }

    t = t % presum[n];

    int l = 0, r = n - 1;
    while(l < r){
        int mid = l + r + 1 >> 1;
        if(presum[mid] > t){
            r = mid - 1;
        }else{
            l = mid;
        }
    }

    LL cur = t - presum[l];
    cout << l + 1 << " " << cur << '\n';




    return 0;
}